﻿@using FluentBootstrap;

@using (Html.Bootstrap().Container().Begin())
{
    @Html.Bootstrap().Heading1("Group")
    using (Html.Bootstrap().Div().SetId("test-group").Begin())
    {
        using (var group = Html.Bootstrap().ButtonGroup().Begin())
        {
            @group.Button("A").SetIcon(Icon.Music)
            @group.LinkButton("L")
            @group.Button("B").SetState(ButtonState.Success)
        }
    }
    
    <hr />
    
    @Html.Bootstrap().Heading1("Toolbar")
    using (Html.Bootstrap().Div().SetId("test-toolbar").Begin())
    {
        using (var toolbar = Html.Bootstrap().ButtonToolbar().Begin())
        {
            using (var group = toolbar.ButtonGroup().Begin())
            {
                @group.Button("A")
                @group.Button("B").SetState(ButtonState.Danger)
            }
            using (var group = toolbar.ButtonGroup().Begin())
            {
                @group.Button("C")
                @group.LinkButton("L", "#").SetState(ButtonState.Success)
                @group.Button("D").SetIcon(Icon.ShareAlt)
            }
        }
    }
    
    <hr />

    @Html.Bootstrap().Heading1("Group Sizing")
    using (Html.Bootstrap().Div().SetId("test-group-sizing").Begin())
    {
        using (var group = Html.Bootstrap().ButtonGroup().SetSize(ButtonGroupSize.Lg).Begin())
        {
            @group.LinkButton("L")
            @group.Button("A")
            @group.Button("B").SetIcon(Icon.Pencil)
        }
        using (var group = Html.Bootstrap().ButtonGroup().SetSize(ButtonGroupSize.Sm).Begin())
        {
            @group.Button("C")
            @group.LinkButton("L").SetIcon(Icon.Phone)
            @group.Button("D")
        }
        using (var group = Html.Bootstrap().ButtonGroup().SetSize(ButtonGroupSize.Xs).Begin())
        {
            @group.Button("E").SetIcon(Icon.Tags)
            @group.Button("F")
            @group.LinkButton("L")
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Nested Dropdown")
    using (Html.Bootstrap().Div().SetId("test-nested-dropdown").Begin())
    {
        using (var group = Html.Bootstrap().ButtonGroup().Begin())
        {
            @group.Button("A")
            @group.LinkButton("L")
            using (var dropdown = group.Dropdown("Dropdown").Begin())
            {
                @dropdown.DropdownLink("B")
                @dropdown.DropdownLink("C")
            }
            using (var dropdown = group.Dropdown("Styled").SetState(ButtonState.Danger).Begin())
            {
                @dropdown.DropdownLink("D")
                @dropdown.DropdownLink("E")
            }
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Vertical")
    using (Html.Bootstrap().Div().SetId("test-vertical").Begin())
    {
        using (var group = Html.Bootstrap().ButtonGroup().SetVertical().Begin())
        {
            @group.Button("A")
            @group.LinkButton("L")
            using (var dropdown = group.Dropdown("Dropdown").Begin())
            {
                @dropdown.DropdownLink("B")
                @dropdown.DropdownLink("C")
            }
            using (var dropdown = group.Dropdown("Styled").SetState(ButtonState.Danger).Begin())
            {
                @dropdown.DropdownLink("D")
                @dropdown.DropdownLink("E")
            }
            @group.Button("F")
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Justified Links")
    using (Html.Bootstrap().Div().SetId("test-justified-links").Begin())
    {
        using (var group = Html.Bootstrap().ButtonGroup().SetJustified().Begin())
        {
            @group.LinkButton("A")
            @group.LinkButton("B")
            @group.LinkButton("Long Link Text")
        }
    }
    
    <hr />

    @Html.Bootstrap().Heading1("Justified Buttons")
    using (Html.Bootstrap().Div().SetId("test-justified-buttons").Begin())
    {
        using (var group = Html.Bootstrap().ButtonGroup().SetJustified().Begin())
        {
            @group.Button("A")
            using (var dropdown = group.Dropdown("B").Begin())
            {
                @dropdown.DropdownLink("C")
                @dropdown.DropdownLink("D")
            }
            @group.Button("Long Button Text")
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Justified Mixed")
    using (Html.Bootstrap().Div().SetId("test-justified-mixed").Begin())
    {
        using (var group = Html.Bootstrap().ButtonGroup().SetJustified().Begin())
        {
            @group.Button("A")
            @group.LinkButton("Long Link Text")
            using (var dropdown = group.Dropdown("C").Begin())
            {
                @dropdown.DropdownLink("D")
                @dropdown.DropdownLink("E")
            }
            @group.Button("Long Button Text")
            @group.LinkButton("F")
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Button Dropdown")
    using (Html.Bootstrap().Div().SetId("test-button-dropdown").Begin())
    {
        using (var dropdown = Html.Bootstrap().ButtonDropdown("Dropdown").SetId("dd1").Begin())
        {
            @dropdown.DropdownHeader("Header")
            @dropdown.DropdownDivider()
            @dropdown.DropdownLink("A")
            @dropdown.DropdownLink("B", "http://www.google.com")
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Button Dropdown No Text")
    using (Html.Bootstrap().Div().SetId("test-button-dropdown-no-text").Begin())
    {
        using (var dropdown = Html.Bootstrap().ButtonDropdown().Begin())
        {
            @dropdown.DropdownHeader("Header")
            @dropdown.DropdownDivider()
            @dropdown.DropdownLink("A")
            @dropdown.DropdownLink("B", "http://www.google.com")
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Button Dropdown With State")
    using (Html.Bootstrap().Div().SetId("test-button-dropdown-with-state").Begin())
    {
        using (var dropdown = Html.Bootstrap().ButtonDropdown("Dropdown").SetState(ButtonState.Danger).Begin())
        {
            @dropdown.DropdownHeader("Header")
            @dropdown.DropdownDivider()
            @dropdown.DropdownLink("A")
            @dropdown.DropdownLink("B", "http://www.google.com")
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Button Dropdown With Icon")
    using (Html.Bootstrap().Div().SetId("test-button-dropdown-with-icon").Begin())
    {
        using (var dropdown = Html.Bootstrap().ButtonDropdown("Dropdown").SetIcon(Icon.Alert).Begin())
        {
            @dropdown.DropdownHeader("Header")
            @dropdown.DropdownDivider()
            @dropdown.DropdownLink("A")
            @dropdown.DropdownLink("B", "http://www.google.com")
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Split Button Dropdown")
    using (Html.Bootstrap().Div().SetId("test-split-button-dropdown").Begin())
    {
        using (var dropdown = Html.Bootstrap().ButtonDropdown("Dropdown").SetId("dd2").SetSplit().Begin())
        {
            @dropdown.DropdownHeader("Header")
            @dropdown.DropdownDivider()
            @dropdown.DropdownLink("A")
            @dropdown.DropdownLink("B", "http://www.google.com")
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Split Button Dropdown No Text")
    using (Html.Bootstrap().Div().SetId("test-split-button-dropdown-no-text").Begin())
    {
        using (var dropdown = Html.Bootstrap().ButtonDropdown().SetSplit().Begin())
        {
            @dropdown.DropdownHeader("Header")
            @dropdown.DropdownDivider()
            @dropdown.DropdownLink("A")
            @dropdown.DropdownLink("B", "http://www.google.com")
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Split Button Dropdown With State")
    using (Html.Bootstrap().Div().SetId("test-split-button-dropdown-with-state").Begin())
    {
        using (var dropdown = Html.Bootstrap().ButtonDropdown("Dropdown").SetSplit().SetState(ButtonState.Danger).Begin())
        {
            @dropdown.DropdownHeader("Header")
            @dropdown.DropdownDivider()
            @dropdown.DropdownLink("A")
            @dropdown.DropdownLink("B", "http://www.google.com")
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Split Button Dropdown With Icon")
    using (Html.Bootstrap().Div().SetId("test-split-button-dropdown-with-icon").Begin())
    {
        using (var dropdown = Html.Bootstrap().ButtonDropdown("Dropdown").SetSplit().SetIcon(Icon.Alert).Begin())
        {
            @dropdown.DropdownHeader("Header")
            @dropdown.DropdownDivider()
            @dropdown.DropdownLink("A")
            @dropdown.DropdownLink("B", "http://www.google.com")
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Button Dropdown Sizes")
    using (Html.Bootstrap().Div().SetId("test-button-dropdown-sizes").Begin())
    {
        using (var dropdown = Html.Bootstrap().ButtonDropdown("Lg").SetSize(ButtonSize.Lg).Begin())
        {
            @dropdown.DropdownLink("A")
            @dropdown.DropdownLink("B")
        }
        using (var dropdown = Html.Bootstrap().ButtonDropdown("XSmall").SetSize(ButtonSize.Xs).Begin())
        {
            @dropdown.DropdownLink("A")
            @dropdown.DropdownLink("B")
        }
    }

    <hr />

    // TODO: Add to tests
    @Html.Bootstrap().Heading1("Split Button Dropdown Sizes")
    using (Html.Bootstrap().Div().SetId("test-split-button-dropdown-sizes").Begin())
    {
        using (var dropdown = Html.Bootstrap().ButtonDropdown("Lg").SetSplit().SetSize(ButtonSize.Lg).Begin())
        {
            @dropdown.DropdownLink("A")
            @dropdown.DropdownLink("B")
        }
        using (var dropdown = Html.Bootstrap().ButtonDropdown("XSmall").SetSplit().SetSize(ButtonSize.Xs).Begin())
        {
            @dropdown.DropdownLink("A")
            @dropdown.DropdownLink("B")
        }
    }

    <hr />

    @Html.Bootstrap().Heading1("Dropup")
    using (Html.Bootstrap().Div().SetId("test-dropup").Begin())
    {
        using (var dropdown = Html.Bootstrap().ButtonDropdown("A").SetDropup().Begin())
        {
            @dropdown.DropdownLink("A")
            @dropdown.DropdownLink("B")
        }
    }
}